package com.jun.admin.core.controller;

import com.jun.admin.core.service.WordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

/**
 * @author yuejun.li
 * @date 2024/10/10 18:06:21
 */
@Api(tags = "报告controller")
@RestController
@RequestMapping("word")
@AllArgsConstructor
@Slf4j
public class WordController {

    private WordService wordService;

    @ApiOperation("导出word（含柱形图 可编辑）")
    @PostMapping("export")
    public void wordExport(HttpServletResponse response) throws UnsupportedEncodingException {
        wordService.wordExport(response);
    }

    @ApiOperation("导出word（含组合图 可编辑）")
    @PostMapping("export2")
    public void wordExport2(HttpServletResponse response) {
        wordService.wordExport2(response);
    }
}
